package main

import (
	"github.com/op/go-logging"
	stdlog "log"
	"os"
)

func NewLogging() (log *logging.Logger) {
	logBackEnd := logging.NewLogBackend(os.Stdout, "", stdlog.LstdFlags|stdlog.Lshortfile)
	//logBackEnd.Color = true
	logging.SetBackend(logBackEnd)

	log = logging.MustGetLogger("ef_service")

	return
}

func SetLogLevel(debug bool) {
	if debug {
		logging.SetLevel(logging.DEBUG, "ef_service")
	} else {
		logging.SetLevel(logging.INFO, "ef_service")
	}
}
